<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<style>
			.alert {
				padding: 15px;
				border: 1px solid #d6e9c6;
				border-radius: 4px;
				color: #3c763d;
				background-color: #dff0d8;
			}
		</style>
	</head>
	<body>
		<script>
			// 1. 创建一个元素节点
			let div = document.createElement('div')

			// 创建一个文本节点
			// let textNode = document.createTextNode('Hi there!')

			// 2. 将元素的类设置为 "alert"
			div.className = 'alert'

			// 3. 填充消息内容
			div.innerHTML = "<strong>Hi there!</strong> You've read an important message."

			// 4. 插入元素
			document.body.append(div)
		</script>
	</body>
</html>
